package dailearn.consumer.controller;

import dailearn.consumer.client.ProducerClient;
import dailearn.consumer.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * @author daify
 * @date 2019-07-09 16:04
 **/
@RestController
@Slf4j
public class UserController {
    
    @Autowired
    private ProducerClient producerClient;
    
    @RequestMapping(value = "getUser",method = RequestMethod.GET)
    public List<User> findAllGood() {
        List <User> allUser = producerClient.findAllUser();
        return allUser;
    } 
    
}
